class Solution:
    # def f_length(self, s, t, i, j):
    #     if i == -1 or j == -1:
    #         return 0
    #     if s[i]==t[j]:
    #         return self.f_length(s,t,i-1,j-1)+1
    #     else:
    #         return self.f_length(s,t,i,j-1)

    # def isSubsequence(self, s: str, t: str) -> bool:
    #     return self.f_length(s,t,len(s)-1,len(t)-1)==len(s)

    def isSubsequence(self,s:str,t:str)->bool:
        i,j=0,0
        while i<len(s) and j<len(t):
            if s[i]==t[j]:
                i+=1
                j+=1
            else:
                j+=1
        return i==len(s)

